#!/bin/bash

echo "Procesos: "
for p in `ps -e | grep TP2 | cut -d" " -f 1` 
do
	echo $p
	kill -9 $p
done

echo "Semaforos: "
for s in `ipcs -s | grep 666 | cut -d" " -f 2` 
do
	echo $s
	ipcrm -s $s
done

echo "Memoria compartida: "
for m in `ipcs -m | grep 644 | cut -d" " -f 2`
do
	echo $m
	ipcrm -m $m
done
	
echo "Cola de mensajes: "
for q in `ipcs -q | grep 777 | cut -d" " -f 2`
do
	echo $q 
	ipcrm -q $q
done
